home *** CD-ROM | disk | FTP | other *** search
/ Holt Researcher: American History / Holt Researcher: American History.iso / pc / modules / search.dxr / 00042_Help Button.ls < prev    next >
Encoding:
Text File  |  2000-01-18  |  1.1 KB  |  42 lines

  1. property ancestor, pCursor
  2.  
  3. on new me, buttonName, castName, theChannel, theStageLoc, descendant
  4.   if objectp(descendant) then
  5.     ancestor = new(script("generic button"), buttonName, castName, theChannel, theStageLoc, descendant)
  6.   else
  7.     ancestor = new(script("generic button"), buttonName, castName, theChannel, theStageLoc, me)
  8.   end if
  9.   pCursor = [member("point hand"), member("point hand mask")]
  10.   return me
  11. end
  12.  
  13. on performFunction me
  14.   global gEnvironObj
  15.   tell the stage
  16.     playSFX(5)
  17.   end tell
  18.   if tooManyOpenWindows() then
  19.     exit
  20.   end if
  21.   if not isMemoryAvailable("open search help") then
  22.     exit
  23.   end if
  24.   fileName = getModulesFolder(gEnvironObj) & "SrchHelp"
  25.   winRect = centerRect(rect(0, 0, 576, 416))
  26.   newWindow = new(script("MIAW Object"), "Search Help", fileName, winRect, 0)
  27.   if objectp(newWindow) then
  28.     openMe(newWindow)
  29.     showMe(newWindow)
  30.   end if
  31. end
  32.  
  33. on enable me
  34.   enable(ancestor)
  35.   set the cursor of sprite the pChannel of me to pCursor
  36. end
  37.  
  38. on disable me
  39.   disable(ancestor)
  40.   set the cursor of sprite the pChannel of me to -1
  41. end
  42.